console.log('测试用');
console.log('测试监视器是否起作用');
const os = require('os');
console.log(os.uptime());
const axios = require('axios');
axios.get('http://api.jirengu.com/getWeather.php?city=lanzhou')
    .then(function (response) {
        console.log(response);
    })
    .catch(function (error) {
        console.log(error);
    });

const myscore = require('./tsymodule.js');
console.log(myscore.Score);
console.log(myscore.myScore('ddd'));

function doSomething(msg, callback) {
    console.log(msg);
    if (typeof callback == "function")
        callback();
};

doSomething("存 5000 块！", function () {
    console.log("稍等，马上办理！");
    console.log('2 分钟后，您的业务已办理完毕！');
});

function example(examplename) {
    console.log(msg);
    if (typeof callback == "function")
        callback();
}

doSomething("测试一下！", function (example) {
    console.log("稍等，正在测试！");
    console.log('测试完毕了，一切正常！');
});

function doSomething(msg, callback) {
    console.log(msg);
    if (typeof callback == "function")
        callback();
};

doSomething("存 5000 块", function () {
    console.log("稍等，马上办理！");
    setTimeout(function () { console.log('5 分钟后，您的业务已办理完毕！'); }, 2000);

});

setTimeout(function () { console.log('5'); }, 5000);
console.log('1');
function test() {
    setTimeout(function () { console.log('2'); }, 1000);
}
test();

console.log('3');
setTimeout(function () { console.log('4'); }, 2000);

const fs = require('fs');
fs.readFile('./files/1.txt', 'utf8', function (err, data) {
    if (err) {
        throw err;
    }
    console.log(data);
});

fs.readFile('./files/2.txt', 'utf8', function (err, data) {
    if (err) {
        throw err;
    }
    console.log(data);
});

fs.readFile('./files/3.txt', 'utf8', function (err, data) {
    if (err) {
        throw err;
    }
    console.log(data);
});

const fs = require('fs')
fs.readFile('./files/1.txt', 'utf8', function (err, data) {
    if (err) {
        throw err;
    } else {
        console.log(data);
        fs.readFile('./files/2.txt', 'utf8', function (err, data) {
            if (err) {
                throw err;
            } else {
                console.log(data);
                fs.readFile('./files/3.txt', 'utf8', function (err, data) {
                    if (err) {
                        throw err;
                    }
                    console.log(data);
                });
            }
        });
    }
});